/**************************************************************************
 *
 * Copyright 2014 MaeckySoft Ltd., Bludenz, Austria.
 * All Rights Reserved.
 *
 **************************************************************************/

#ifdef __unix__

#ifndef MOPENGL_H
#define MOPENGL_H

#define USE_FULL_GL 0

#if USE_FULL_GL
#include "gl_wrap.h"  /* use full OpenGL */
#else
#include <GLES2/gl2.h>  /* use OpenGL ES 2.x */
#endif
#include <EGL/egl.h>
#include <M3DBase.h>

class MOpenGL : M3DBase
{
    public:
        MOpenGL(int iDebug=0);
        ~MOpenGL();
        void make_z_rot_matrix(GLfloat GLfAngle, GLfloat *GLfMatrix);
        void make_scale_matrix(GLfloat GLfScaleX, GLfloat GLfScaleY, GLfloat GLfScaleZ, GLfloat *GLfMatrix);
        void mul_matrix(GLfloat *GLfProduct, const GLfloat *GLfMatrixA, const GLfloat *GLfMatrixB);
        void draw(void);
        void reshape(int iWidth, int iHeight);
        void create_shaders(void);
        void init(void);
		void printMethodInfo(std::string method);
        void incViewRotY(GLfloat GLfRotY);
        void incViewRotX(GLfloat GLfRotX);
    protected:
    private:
        GLfloat m_GLfView_RotX, m_GLfView_RotY;
        GLint m_GLiU_Matrix;
        GLint m_GLiAttr_Pos, m_GLiAttr_Color;

};

#endif

#endif // MOPENGL_H
